package com.hamilton.erik.pt.core.enumeration;

public enum EnclosureMaintenanceAction {

	DEEP_CLEANED("Deep_Cleaned", "Deep cleaned the enclosure."),
	SPOT_CLEANED("Spot_Cleaned", "Spot cleaned the enclosure."),
	CHANGED_SUBSTRATE("Changed_Substrate", "Changed the enclosure substrate.");
	
	private String maintenanceAction;
	private String description;
	
	private EnclosureMaintenanceAction(String action, String description) {
		this.maintenanceAction = action;
		this.description = description;
	}
	
	public static EnclosureMaintenanceAction fromAction(String value) {
		for(EnclosureMaintenanceAction action : values()) {
			if(action.getAction().equalsIgnoreCase(value)) {
				return action;
			}
		}
		
		return null;
	}
	
	public static EnclosureMaintenanceAction fromDescription(String value) {
		for(EnclosureMaintenanceAction action : values()) {
			if(action.getDescription().equalsIgnoreCase(value)) {
				return action;
			}
		}
		
		return null;
	}
	
	public String getAction() {
		return maintenanceAction;
	}
	
	public String getDescription() {
		return description;
	}
	
	public String toString() {
		return description;
	}
	
}
